//
//  DateView.m
//  I_LiaoNing
//
//  Created by 王心磊 on 15-4-10.
//  Copyright (c) 2015年 王心磊. All rights reserved.
//

#import "DateView.h"

#define WIDTH ([UIScreen mainScreen].bounds.size.width/375)
#define HEIGH ([UIScreen mainScreen].bounds.size.height/667)
@implementation DateView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

-(void)createSubViews
{
    self.imageView = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
    [self addSubview:self.imageView];
    [_imageView release];
    UIImageView *imagev = [[UIImageView alloc] init];
    imagev.backgroundColor = [UIColor blackColor];
    imagev.frame = CGRectMake(0, 0, 375 * WIDTH, 667 * HEIGH);
    
    imagev.alpha = 0.4;
    [self.imageView addSubview:imagev];

    
    self.titleLabel = [[UILabel alloc ]initWithFrame:CGRectMake(145, 150, 100, 50 )];
    self.titleLabel.font = [UIFont systemFontOfSize:30];
    self.titleLabel.textColor = [UIColor whiteColor];
    [self addSubview:self.titleLabel];
    
    self.button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.button1.frame = CGRectMake(70 * WIDTH, 260 * HEIGH, 70 * WIDTH, 70 * HEIGH);
//    self.button1.backgroundColor = [UIColor redColor];
    [self.button1 addTarget:self action:@selector(button1Ation:) forControlEvents:UIControlEventTouchUpInside];
    [self.button1 setBackgroundImage:[UIImage imageNamed:@"iconfont-jingdianicon-2.png"] forState:UIControlStateNormal];
    [self addSubview:self.button1];
    
    self.label1 = [[UILabel alloc]initWithFrame:CGRectMake(85*WIDTH, 300*HEIGH, 70*WIDTH, 70*HEIGH)];
    self.label1.text = @"景点";
    self.label1.textColor = [UIColor whiteColor];
    self.label1.backgroundColor = [UIColor clearColor];
    self.label1.font = [UIFont systemFontOfSize:20];
    [self addSubview:self.label1];
    [self.label1 release];
    
    
    
    
    self.button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.button2.frame = CGRectMake(230 * WIDTH, 260 * HEIGH, 70 * WIDTH, 70 * HEIGH);
    //    self.button1.backgroundColor = [UIColor redColor];
    [self.button2 addTarget:self action:@selector(button2Ation:) forControlEvents:UIControlEventTouchUpInside];
    [self.button2 setBackgroundImage:[UIImage imageNamed:@"iconfont-canyinmeishi.png"] forState:UIControlStateNormal];
    [self addSubview:self.button2];
    
    self.label2 = [[UILabel alloc]initWithFrame:CGRectMake(235*WIDTH, 300*HEIGH, 70*WIDTH, 70*HEIGH)];
    self.label2.text = @"美食";
    self.label2.textColor = [UIColor whiteColor];
    self.label2.backgroundColor = [UIColor clearColor];
    self.label2.font = [UIFont systemFontOfSize:20];
    [self addSubview:self.label2];
    [self.label2 release];


    self.button3 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.button3.frame = CGRectMake(70 * WIDTH, 400 * HEIGH, 70 * WIDTH, 70 * HEIGH);
    //    self.button1.backgroundColor = [UIColor redColor];
    [self.button3 addTarget:self action:@selector(button3Ation:) forControlEvents:UIControlEventTouchUpInside];
    [self.button3 setBackgroundImage:[UIImage imageNamed:@"iconfont-gouwu.png"] forState:UIControlStateNormal];
    [self addSubview:self.button3];
    
    self.label3 = [[UILabel alloc]initWithFrame:CGRectMake(85*WIDTH, 450*HEIGH, 70*WIDTH, 70*HEIGH)];
    self.label3.text = @"购物";
    self.label3.textColor = [UIColor whiteColor];
    self.label3.backgroundColor = [UIColor clearColor];
    self.label3.font = [UIFont systemFontOfSize:20];
    [self addSubview:self.label3];
    [self.label3 release];

    
    self.button4 = [UIButton buttonWithType:UIButtonTypeCustom];
    self.button4.frame = CGRectMake(230 * WIDTH, 400 * HEIGH, 70 * WIDTH, 70 * HEIGH);
    [self.button4 addTarget:self action:@selector(button4Ation:) forControlEvents:UIControlEventTouchUpInside];
    [self.button4 setBackgroundImage:[UIImage imageNamed:@"iconfont-zhutihuodong.png"] forState:UIControlStateNormal];
    [self addSubview:self.button4];
    
    self.label4 = [[UILabel alloc]initWithFrame:CGRectMake(235*WIDTH, 450*HEIGH, 70*WIDTH, 70*HEIGH)];
    self.label4.text = @"活动";
    self.label4.textColor = [UIColor whiteColor];
    self.label4.backgroundColor = [UIColor clearColor];
    self.label4.font = [UIFont systemFontOfSize:20];
    [self addSubview:self.label4];
    [self.label4 release];

}

- (void)button1Ation:(UIButton *)button
{
    [self.myDelete push1];
    
}
- (void)button2Ation:(UIButton *)button
{
    [self.myDelete push2];
}
-(void)button3Ation:(UIButton *)button
{
    [self.myDelete push3];
}
-(void)button4Ation:(UIButton *)button
{
    [self.myDelete push4];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
